-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Testing] Fix wrong include in custom bootstrap for tests #11899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think we should merge this in 3.4, because |
That's tricky because our setup guidelines don't make use of Flex so you won't get this file without doing so explicitly, right? |
@xabbuh yes, I use Flex and it's new project. |
@xabbuh do you have any questions? Is it ready to be merged or I have to change something? |
Well, I still think that this does not really fit the 3.4 docs if people following the setup guide not using Flex will run into errors when following this change (because they do not have the |
@xabbuh I did a PR in 4.3, not in 3.4. |
Yes, but Javier asked whether we should merge into the |
I think it's not related to 3.4. I also started project with 3.4 and I didn't remember such a problem there. |
If 3.4 is OK, then we'll merge in 4.2 Thanks. |
@javiereguiluz right now I created new Symfony 3.4 project and in phpunit.xml.dist I found:
So, it's not relevant for SF 3.4. Changes can be merged. |
ping @javiereguiluz |
Thank you @gregurco. |
…s (gregurco) This PR was merged into the 4.3 branch. Discussion ---------- [Testing] Fix wrong include in custom bootstrap for tests Hello. There is a wrong include in custom `tests/bootstrap.php` for tests. Till 4.3 it was ok, but from 4.3 following the article you will receive next error: ``` LogicException: You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the App\Tests\Foo\BarTest::createKernel() or App\Tests\Foo\BaTest::getKernelClass() method. ``` The problem exists, because the sequence of bootstrap is changes: `phpunit.dist.xml -> config/bootstrap.php -> vendor/autoload.php` and normally if something is injected in phpunit config, it should respect the sequence: `phpunit.dist.xml -> tests/bootstrap.php (CUSTOM) -> config/bootstrap.php -> vendor/autoload.php` Actual state in documentation (wrong one) `phpunit.dist.xml -> tests/bootstrap.php -> vendor/autoload.php` Red to recipe: https://github.com/symfony/recipes/blob/master/phpunit/phpunit/4.7/phpunit.xml.dist#L8 Thanks, Vlad. Commits ------- f34bd0b Fix wrong include in custom bootstrap for tests
Hello.
There is a wrong include in custom
tests/bootstrap.php
for tests. Till 4.3 it was ok, but from 4.3 following the article you will receive next error:The problem exists, because the sequence of bootstrap is changes:
phpunit.dist.xml -> config/bootstrap.php -> vendor/autoload.php
and normally if something is injected in phpunit config, it should respect the sequence:
phpunit.dist.xml -> tests/bootstrap.php (CUSTOM) -> config/bootstrap.php -> vendor/autoload.php
Actual state in documentation (wrong one)
phpunit.dist.xml -> tests/bootstrap.php -> vendor/autoload.php
Red to recipe: https://github.com/symfony/recipes/blob/master/phpunit/phpunit/4.7/phpunit.xml.dist#L8
Thanks, Vlad.